﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ProjectList.ascx.cs" Inherits="CtrlProjectList" %>
<asp:GridView ID="m_gvProjects" runat="server" DataSource="<%# Projects %>" AutoGenerateColumns="False"
    DataMember="Project">
    <Columns>
        <asp:TemplateField HeaderText="Name">
            <ItemTemplate>
                <span>
                    <%# Eval("Project.Name")%></span>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Description">
            <ItemTemplate>
                <span>
                    <%# Eval("Project.Description")%></span>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="">
            <ItemTemplate>
            <a href='<%# String.Format("{0}?id={1}",System.Web.VirtualPathUtility.ToAbsolute("~/User/EditProject.aspx"), Eval("Project.ProjectID")) %>' >Edit</a>

            <a href='<%# String.Format("{0}?id={1}",System.Web.VirtualPathUtility.ToAbsolute("~/User/ViewProject.aspx"), Eval("Project.ProjectID")) %>' >View</a>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="">
            <ItemTemplate>
                <a href='<%# String.Format("{0}?id={1}",System.Web.VirtualPathUtility.ToAbsolute("~/User/DeleteProject.aspx"), Eval("Project.ProjectID")) %>' >Delete</a>
            </ItemTemplate>
        </asp:TemplateField>
    </Columns>
</asp:GridView>
